﻿import QtQuick 2.0
import "../components"

Item {
    property var td;
    property int time;
    property int times;
    Connections{  // qmlre
        target: MACO
        onAdvalread:{
            tab.setData(tab.selectedRow,tab.selectedCol,adval)
        }
    }
    id: root
    anchors.fill: parent
    Row{
        spacing: 15*dp
        CustomComboBox{
            title: "通道"
            textWidth: 40*dp
            editWidth: 90*dp
            model: ["FAM", "ROX", "VIC", "CY5"]
            onCurrentText: {
                td = text;
                MACO.tdxz(text);
            }
        }
        LineEditor{
            id:cjt
            title: "采集间隔(s)"
            editWidth: 100*dp
            textWidth: 85*dp
            douflag: true
            onTextChanged: {
                var inputValue = parseInt(text);
                if (!isNaN(inputValue)) {
                    time = inputValue;
                }
            }
            Keys.onTabPressed: {
                focus = false
                cjts.focus = true
            }
        }
        LineEditor{
            id:cjts
            title: "采集次数"
            editWidth: 100*dp
            textWidth: 70*dp
            intflag: true
            onTextChanged: {
                var inputValue = parseInt(text);
                if (!isNaN(inputValue)) {
                    times = inputValue;
                }
            }
            Keys.onTabPressed: {
                focus = false
                cjt.focus = true
            }
        }
//        CustomComboBox{
//            editWidth: 140*dp
//            model: ["FAM通道开", "ROX通道开", "VIC通道开", "CY5通道开"]
//        }
        PushButton{
            title: "单步采集"
            defaultMode1: true
            onReleased: {
                MACO.ad1time()
            }
        }

        PushButton{
            title: "连续采集"
            defaultMode1: true
            onReleased: {
                MACO.adtimes(tab.selectedRow,tab.selectedCol,times,time,td,0)
            }
        }
        PushButton{
            title: "运动"
            defaultMode1: true
            onReleased: {

            }
        }
    }

    GridTable{
        id:tab
        y: 60*dp
        columnCount: 12
        rowCount: 8
        title: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
        title2: ["", "A", "B", "C", "D", "E", "F", "G", "H"]
    }

}
